<template>
    <base-dialog v-bind="$attrs" v-on="$listeners" :title="title" @submit="toAdd"  :disabled="disabled">
        <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px" :disabled="disabled">
          <el-form-item label="角色名" prop="name">
            <el-input v-model="formData.name"></el-input>
          </el-form-item>
          <el-form-item label="描述" prop="description">
            <el-input v-model="formData.description"></el-input>
          </el-form-item>
          <el-form-item label="标签" prop="label">
            <el-input v-model="formData.label"></el-input>
          </el-form-item>
          <el-form-item label="排序" prop="no_order">
            <el-input-number v-model="formData.no_order"></el-input-number>
          </el-form-item>
          <el-form-item label="是否显示" prop="status">
            <el-radio-group v-model="formData.status">
              <el-radio :label="true">是</el-radio>
              <el-radio :label="false">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="是否绑定部门" prop="binding">
            <el-radio-group v-model="formData.binding">
              <el-radio :label="true">是</el-radio>
              <el-radio :label="false">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
    </base-dialog>
</template>
<script>
    import BaseDialog from "@/components/Common/BaseDialog";
    import DetailDialog from "@/mixins/DetailDialog";
    export default {
        mixins: [DetailDialog],
        components: { BaseDialog},
        data() {
            return {
                budgetList:[],
                formData: {
                  name: "",
                  description: "",
                  label: "",
                  status:true,
                  binding:false,
                  no_order:0
                },
                rules: {
                  name: {
                    required: true,
                    message: "请输入角色名",
                    trigger: "blur"
                  }
                },
            }
        },
        computed: {
            title() {
                return this.disabled ? '查看' : this.formData.id ? "编辑" : "新增"
            },
        },
        watch: {},
        created() {
        },
        mounted() {
        },
        methods: {
        }
    }
</script>
